<?php

namespace app\admin\model\stock;

use think\Model;

/**
 * Locations
 */
class Locations extends Model
{
    // 表主键
    protected $pk = 'loccode';
    
    // 表名
    protected $name = 'stock_locations';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;


    public function taxprovinceidTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\setup\Taxprovinces::class, 'taxprovinceid', 'taxprovinceid');
    }

    public function glaccountcodeTable(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\fm\Chartmaster::class, 'glaccountcode', 'accountcode');
    }

    public function mobilePay(): \think\model\relation\BelongsTo
    {
        return $this->belongsTo(\app\admin\model\pay\Mchconfig::class, 'mobile_pay_id', 'Id');
    }
}